/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2022-2022. All rights reserved.
 * Description: usbxhci driver Vendor Hooks
 */

#ifdef CONFIG_VENDOR_USBXHCI_HOOKS
#undef TRACE_SYSTEM
#define TRACE_SYSTEM usbxhci

#define TRACE_INCLUDE_PATH trace/hooks
#if !defined(_TRACE_HOOK_USBXHCI_HOOKS_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_HOOK_USBXHCI_HOOKS_H
#include <linux/tracepoint.h>
#include <trace/hooks/vendor_hooks.h>

struct xhci_td;
struct xhci_ring;
struct xhci_bus_state;
struct xhci_hcd;
struct pci_dev;
struct usb_hcd;
struct usb_device;
struct usb_host_endpoint;

DECLARE_HOOK(vendor_usb_ignore_babble_err,
	TP_PROTO(struct xhci_td *td, struct xhci_ring *ep_ring, int *status),
	TP_ARGS(td, ep_ring, status));
DECLARE_HOOK(vendor_usb_get_u3_port_status,
	TP_PROTO(u32 link_state, bool *wake_resume),
	TP_ARGS(link_state, wake_resume));
DECLARE_HOOK(vendor_usb_parse_frame_interval,
	TP_PROTO(struct usb_device *udev, struct usb_host_endpoint *ep, u32 *ret),
	TP_ARGS(udev, ep, ret));
DECLARE_HOOK(vendor_usb_endpoint_init,
	TP_PROTO(struct usb_device *udev, struct usb_host_endpoint *ep, u32 *max_esit_payload,
		u32 *max_packet),
	TP_ARGS(udev, ep, max_esit_payload, max_packet));
DECLARE_HOOK(vendor_xhci_pci_quirks,
	TP_PROTO(struct device *dev, struct xhci_hcd *xhci),
	TP_ARGS(dev, xhci));

#endif
/* This part must be outside protection */

#include <trace/define_trace.h>

#else

#include <linux/tracepoint.h>
struct xhci_td;
struct xhci_ring;
struct xhci_bus_state;
struct xhci_hcd;
struct pci_dev;
struct usb_hcd;
struct usb_device;
struct usb_host_endpoint;

DECLARE_EVENT_NOP(vendor_usb_ignore_babble_err,
	TP_PROTO(struct xhci_td *td, struct xhci_ring *ep_ring, int *status),
	TP_ARGS(td, ep_ring, status));
DECLARE_EVENT_NOP(vendor_usb_get_u3_port_status,
	TP_PROTO(u32 link_state, bool *wake_resume),
	TP_ARGS(link_state, wake_resume));
DECLARE_EVENT_NOP(vendor_usb_parse_frame_interval,
	TP_PROTO(struct usb_device *udev, struct usb_host_endpoint *ep, u32 *ret),
	TP_ARGS(udev, ep, ret));
DECLARE_EVENT_NOP(vendor_usb_endpoint_init,
	TP_PROTO(struct usb_device *udev, struct usb_host_endpoint *ep, u32 *max_esit_payload,
		u32 *max_packet),
	TP_ARGS(udev, ep, max_esit_payload, max_packet));
DECLARE_EVENT_NOP(vendor_xhci_pci_quirks,
	TP_PROTO(struct device *dev, struct xhci_hcd *xhci),
	TP_ARGS(dev, xhci));

#endif
